package com.cskaoyan.javase.oop1._7game._1pvz;

/**
 * 僵尸类
 *
 * @since 11:03
 * @author wuguidong@cskaoyan.onaliyun.com
 */
public class Zombie {
    // 属性
    String name;
    int hp;
    int damage;
    double speed;

    Plant zombieP;

    public Zombie(String name, int hp, int damage, double speed) {
        this.name = name;
        this.hp = hp;
        this.damage = damage;
        this.speed = speed;
    }

    // 行为
    public void attack() {
        System.out.println(name + "正在攻击" + zombieP.name);
    }

    public void beAttacked() {
        System.out.println(name + "正在被" + zombieP.name + "攻击,还剩下" + (hp - zombieP.damage) + "血量");
    }

    public void move() {
        System.out.println(name + "正在以" + speed + "的速度,接近你的脑子~");
    }

    public void eat() {
        System.out.println(name + "吃掉了你的脑子,真香~游戏结束了~");
    }
}
